
#import "DGPrintInfo.h"

static NXAtom rcsSTR;

@implementation DGPrintInfo

+ initialize
{
	if(self == [DGPrintInfo class]){
        rcsSTR = NXUniqueString("Wood-DGPrintInfo");
	}
	return self;
}

+ (const char *)rcsId
{
	return rcsSTR;
}

- write:(NXTypedStream *)stream
{
	[super write:stream];
	NXWriteTypes(stream,"iiic",&horizontalPages,&verticalPages,&unit,&printMarker);
	return self;
}	

- read:(NXTypedStream *)stream
{
	[super read:stream];
	NXReadTypes(stream,"iiic",&horizontalPages,&verticalPages,&unit,&printMarker);
	return self;
}

- setPrintMarker:(char)aMarker
{
	printMarker = aMarker;
	return self;
}

- setVerticalPages:(int)vPages
{
	verticalPages = vPages;
	return self;
}

- setHorizontalPages:(int)hPages
{
	horizontalPages = hPages;
	return self;
}

- setUnit:(int)aUnit
{
	unit = aUnit;
	return self;
}

- (char)printMarker
{
	return printMarker;
}

- getScaledPageSize:(NXSize *)aSize
{
	NXCoord lm,rm,tm,bm;
	float scF;
	
	[self getMarginLeft:&lm right:&rm top:&tm bottom:&bm];
	scF = [self scalingFactor];
	aSize->width = scF * (NX_WIDTH([self paperRect]) - lm - rm);
	aSize->height = scF * (NX_HEIGHT([self paperRect]) - tm -bm);
	return self;
}

- (int)verticalPages
{
	return verticalPages;
}

- (int)horizontalPages
{
	return horizontalPages;
}

- (int)unit
{
	return unit;
}

- init
{
	[super init];
	printMarker = '\000';
	horizontalPages = verticalPages = unit = 1;
	return self;
}


@end
